home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 003.dms / 003.adf / TEXT / chapter11.txt < prev    next >
Text File  |  1992-09-02  |  4KB  |  169 lines

  1.  
  2.               The Absolute Beginners Guide To Amos
  3.               -------------------------------------
  4.                          Chapter eleven
  5.                          --------------
  6.  
  7.  
  8. I think it`s high time we took a closer look at pictures, EXAMPLE11.Amos
  9. listed below, is a mini slide show with music program.
  10.  
  11.  
  12. REM  Mini slideshow with fades and music
  13.  
  14. HIDE: TRACK LOOP ON: TRACK PLAY 5 
  15. BEGIN:
  16. UNPACK 12 TO 0
  17. WAIT 400
  18. FADE 5
  19. WAIT 75
  20. UNPACK 11 to 0
  21. WAIT 400
  22. FADE 1
  23. WAIT 15
  24. UNPACK 10 TO 0
  25. WAIT 400
  26. FADE 10
  27. WAIT 150 
  28. GOTO BEGIN
  29.  
  30.  
  31. Hold on! Where are the LOADIFF and TRACK LOAD commands for the pictures and 
  32. music? The answer is, we don`t need them because the pictures and music
  33. are already stored inside the program in memory banks.  First I will explain
  34. about the music. Right you have just loaded up Amos and you are sitting in
  35. front of the blank editor, press escape to go into direct mode, now type in:
  36.  
  37. TRACK LOAD "DF0:MUSIC/MOD.FUN",5
  38.  
  39. This is the same line that we would use in the program normally to LOAD the
  40. the music.  Obviously you can change the name of the file you want to load 
  41. from "DF0:MUSIC/MOD.FUN",5 to that of your choice.
  42.  
  43. The music is now stored in bank five, now still in Direct mode type: 
  44.  
  45. TRACK PLAY 5  
  46.  
  47. and you will now hear the music play.
  48.  
  49. When you save the program the contents of any permanent memory bank in use is
  50. saved along with the basic listing and when you reload it the music will 
  51. still be there in bank five.  So a simple, TRACK PLAY 5, will start it again.  
  52. There are certain types of banks that are not saved along with the program 
  53. but we are not concerned with that at the moment as we are concentrating on 
  54. music and pictures.
  55.  
  56. The pictures use the same technique.  I loaded the music into bank five as 
  57. described then I loaded a picture from disk into the default screen which is
  58. zero like this,
  59.  
  60. LOADIFF "DF0:PICS/SONIC.IFF",0
  61.  
  62. The same as we would inside a program, but staying in direct mode. 
  63. I then typed the magical command,
  64.  
  65. SPACK 0 to 10
  66.  
  67. Which tells Amos to sPACK the picture in screen 0 and store it in bank ten.
  68. I repeated this for two more pictures SPACKing them into banks 11 and 12
  69. then I typed, 
  70.  
  71. LISTBANK
  72.  
  73. to check the banks were there and then returned to the blank editor to save 
  74. the blank program listing off which automatically saved the banks along with
  75. it.  To display a SPACKed picture from a bank we use the command,
  76.  
  77. UNPACK BANK TO SCREEN
  78.  
  79. So if for example we had a picture stored in bank 7 and we wanted to UNPACK
  80. it to the default screen we would use:
  81.  
  82. UNPACK 7 TO 0
  83.  
  84. And that is all there is to it.  The benefits of SPACKING pictures are that
  85. because they are packed they use up less memory and disk space, keep the
  86. program listing free of LOAD commands and no slow disk access is required.
  87.  
  88. Note: When you UNPACK a picture it does not erase the bank so you can keep
  89.       UNPACKING as many copies of the picture as you need. If you do need or
  90.       want to delete the picture from the bank just use ERASE bank number.
  91.       For example ERASE 10.
  92.  
  93. Note2: Amos automatically uses the palette of any picture you unpack in case
  94.        you were wondering!
  95.  
  96.  
  97.  
  98. So to the program breakdown:
  99.  
  100.   
  101. HIDE: TRACK LOOP ON: TRACK PLAY 5
  102. ----------------------------------
  103. Hide the mouse pointer to keep things tidy, set the music to LOOP, 
  104. PLAY the music that is stored in bank five.
  105.  
  106. BEGIN:
  107. ------
  108. A label (or marker if you like) for GOTO to -  GO TO .
  109.  
  110. UNPACK 12 TO 0
  111. --------------
  112. Unpack the previously SPACKED picture from bank 12 to screen 0.
  113.  
  114. WAIT 400
  115. --------
  116. WAIT eight seconds to give the user time to view the picture.
  117.  
  118. FADE 5
  119. ------
  120. Literally FADEs the screen to black, try different values if you like.
  121.  
  122. WAIT 75
  123. -------
  124. This WAIT is necessary to give the FADE enough time to finish, you can 
  125. work out the exact timing by using FADE speed*15 (5*15=75)
  126.  
  127. UNPACK 11 to 0
  128. --------------
  129. Unpack the picture in bank 11 to screen 0.
  130.  
  131. WAIT 400
  132. --------
  133. Wait 8 seconds.
  134.  
  135. FADE 1
  136. ------
  137. Try a different fade.
  138.  
  139. WAIT 15
  140. -------
  141. WAIT 1*15
  142.  
  143. UNPACK 10 TO 0
  144. --------------
  145. Unpack bank 10 to screen 0.
  146.  
  147. WAIT 400
  148. --------
  149. Guess!
  150.  
  151. FADE 10
  152. -------
  153. FADE it out.
  154.  
  155. WAIT 150
  156. --------
  157. Give the FADE time to do it`s job.
  158.  
  159. GOTO BEGIN
  160. ----------
  161. Jump to the line marked LABEL and start unpacking the pics again.
  162.  
  163.  
  164. As a bit of homework why not change the pictures, music and FADEs?
  165.  
  166.  
  167.  
  168. End of chapter eleven.  
  169.